export default [
  // user
  // 目录说明: ./表示当前目录；../表示上级目录
  // component 指向的路由组件文件是从 src/pages 目录开始解析的
  // 如果配置了 routes，则优先使用配置式路由，且约定式路由会不生效
  // 官网查看：https://umijs.org/zh/config/#routes

  {
    path: '/user',
    component: '../layouts/UserLayout',
    routes: [
      { path: '/user', redirect: '/user/login' },
      { path: '/user/login', component: './User/Login' },
      { path: '/user/register', component: './User/Register' },
      { path: '/user/register-result', component: './User/RegisterResult' },
      { path: '/user/reset-password', component: './User/Resetpassword' },
    ],
  },
  // app
  {
    path: '/',
    component: '../layouts/BasicLayout',
    Routes: ['src/pages/Authorized'],
    authority: ['admin', 'user'],
    routes: [
      // 系统管理
      {
        path: '/sys',
        name: '系统管理模块',
        routes: [
          {
            path: '/sys/sysuser',
            name: 'menu.sys.userManager',
            component: './Sys/Sysuser',
          },
          {
            path: '/sys/sysrole',
            name: 'menu.sys.roleManager',
            component: './Sys/SysRole',
          },
          {
            path: '/sys/menu',
            name: 'menu.sys.menuManager',
            component: './Sys/Sysmenu',
          },
          {
            path: '/sys/schedule',
            name: 'menu.sys.schedule',
            component: './Sys/Schedule',
          },
          {
            path: '/sys/generator',
            name: 'menu.sys.generator',
            component: './Sys/Generator',
          },
          {
            path: '/sys/log',
            name: 'menu.sys.log',
            component: './Sys/SysLog',
          },
          {
            path: '/sys/sysjpushrecord',
            name: 'menu.sys.jpushRecord',
            component: './Sys/SysjpushRecord',
          },
          {
            path: '/sys/syssetting',
            name: 'menu.sys.sysSetting',
            component: './Sys/Syssetting',
          },
          {
            path: '/sys/sysmessagecenter',
            name: '消息中心',
            component:'./Sys/SysMessageCenter',
          },
        ],
      },
      //==========生成的代码写在这里================
      {
        path: '/mall',
        name: '店铺管理',
        routes: [
          {
            path: '/mall/tbuser',
            name: '用户信息',
            component: './generator/common/tbuser',
          },
          {
            path: '/mall/category',
            name: '商品分类',
            component: './generator/mall/category',
          },
          {
            path: '/mall/product',
            name: '商品管理',
            component: './generator/mall/product',
          },
          {
            path: '/mall/gift',
            name: '赠品管理',
            component: './generator/promotion/gift.js',
          },
          {
            path: '/mall/online',
            name: '在线资源',
            routes: [
              {
                path: '/mall/online/resKinds',
                name: '在线资源分类',
                component: './generator/business/onlineResKinds',
              },
              {
                path: '/mall/online/res',
                name: '在线资源',
                component: './generator/business/onlineRes',
              },
              {
                path: '/mall/online/rescolumn',
                name: '资源专栏',
                component: './generator/business/onlinerescolumn',
              },
            ],
          },
        ],
      },
      // 平台管理
      {
        path: '/platform',
        name: '平台管理模块',
        routes: [
          {
            path: '/platform/clause',
            name: '文案维护菜单',
            component: './generator/common/tinfclauseinfo',
          },
          {
            path: '/platform/advertise',
            name: '广告管理菜单',
            component: './generator/common/infadvertise',
          },
          {
            path: '/platform/message',
            name: '消息管理菜单',
            component: './generator/common/infmessage',
          },
          {
            path: '/platform/questions',
            name: '用户答疑菜单',
            component: './generator/common/infquestions',
          },
          {
            path: '/platform/feedback',
            name: '用户答疑菜单',
            component: './generator/common/sysfullfeedback',
          },
          {
            path: '/platform/infversioninfo',
            name: '版本更新',
            component: './generator/common/infversioninfo',
          },
        ],
      },
      {
        path: '/statistical',
        name: '统计管理',
        routes: [
          {
            path: '/statistical/financial',
            name: '财务统计',
            component: './generator/business/financial',
          },
          {
            path: '/statistical/thirdorder',
            name: '第三方订单统计',
            component: './generator/business/thirdorder',
          },
          {
            path: '/statistical/addressorder',
            name: '地区销量统计',
            component: './generator/business/addressorder',
          },
        ],
      },
      // 配置模块
      {
        path: '/config',
        name: '配置管理模块',
        routes: [
          {
            path: '/config/configMgr',
            name: 'configManager',
            component: './Sys/Config/SysConfigMgr',
          },
          {
            path: '/config/shortMsg',
            name: '短信平台',
            routes: [
              {
                path: '/config/shortMsg/cfg',
                name: '短信配置',
                component: './generator/common/cfgsms',
              },
              {
                path: '/config/shortMsg/template',
                name: '短信模板',
                component: './generator/common/cfgsmsmodel',
              },
              {
                path: '/config/shortMsg/logs',
                name: '短信发送记录',
                component: './generator/common/cfgsmslog',
              },
            ],
          },
          {
            path: '/config/express',
            name: '快递公司模块',
            component: './generator/common/infexpress',
          },
          {
            path: '/config/infarea',
            name: '省市区管理',
            component: './generator/common/infarea',
          },
          {
            path: '/config/dict',
            name: '字典管理',
            routes: [
              {
                path: '/config/dict/type',
                name: '字典类型',
                component: './generator/common/infdicttype',
              },
              {
                path: '/config/dict/info',
                name: '字典数据',
                component: './generator/common/infdictinfo',
              },
            ],
          },
        ],
      },
      // 活动管理
      {
        path: '/promotion',
        name: '活动管理',
        routes: [
          {
            path: '/promotion/homeNavi',
            name: '首页活动配置',
            component: './generator/business/homeNavi',
          },
          {
            path: '/promotion/tryout',
            name: '试读管理',
            routes: [
              {
                path: '/promotion/tryout/tryout',
                name: '试读管理',
                component: './generator/promotion/tryout',
              },
              {
                path: '/promotion/tryout/tryoutRecord',
                name: '试读记录',
                component: './generator/promotion/tryoutRecord',
              },
            ],
          },
          {
            path: '/promotion/recommend',
            name: '推荐有礼',
            routes: [
              {
                path: '/promotion/recommend/recommendInfo',
                name: '活动配置',
                component: './generator/promotion/recommend',
              },
              {
                path: '/promotion/recommend/recommendShare',
                name: '分享记录',
                component: './generator/promotion/recommendshare',
              },
            ],
          },
          {
            path: '/promotion/groupon',
            name: '拼团管理',
            routes: [
              {
                path: '/promotion/groupon/activity',
                name: '拼团活动',
                component: './generator/promotion/groupon',
              },
              {
                path: '/promotion/groupon/record',
                name: '拼团记录',
                component: './generator/promotion/grouponrecord',
              },
            ],
          },
          {
            path: '/promotion/topic',
            name: '专题管理',
            component: './generator/promotion/topic',
          },
          {
            path: '/promotion/draw',
            name: '抽奖管理',
            routes: [
              {
                path: '/promotion/draw/draw',
                name: '抽奖活动',
                component: './generator/promotion/draw',
              },
              {
                path: '/promotion/draw/drawrecord',
                name: '抽奖记录',
                component: './generator/promotion/drawrecord',
              },
            ],
          },
          {
            path: '/promotion/coupon',
            name: '优惠券管理',
            component: './generator/promotion/coupon',
          },
          {
            path: '/promotion/seckill',
            name: '秒杀管理',
            component: './generator/promotion/seckill',
          },
          {
            path: '/promotion/presale',
            name: '预售管理',
            component: './generator/promotion/presale',
          },
          {
            path: '/promotion/limitdiscount',
            name: '限时折扣',
            component: './generator/promotion/limitdiscount',
          },
          {
            path: '/promotion/reward',
            name: '满减满赠',
            component: './generator/promotion/reward',
          },
        ],
      },
      // 订单模块相关
      {
        path: '/order',
        name: '订单管理模块',
        routes: [
          {
            path: '/order/order',
            name: '订单管理',
            component: './generator/order/Order',
          },
          {
            path: '/order/refunds',
            name: '售后服务',
            component: './generator/order/refunds',
          },
          {
            path: '/order/platform',
            name: '导入平台',
            component: './generator/order/importplatform',
          },
        ],
      },
      // dashboard
      { path: '/', redirect: '/dashboard/analysis' },
      {
        path: '/dashboard',
        name: 'dashboard',
        icon: 'dashboard',
        routes: [
          {
            path: '/dashboard/analysis',
            name: 'analysis',
            component: './Dashboard/Analysis',
          },
          {
            path: '/dashboard/monitor',
            name: 'monitor',
            component: './Dashboard/Monitor',
          },
          {
            path: '/dashboard/workplace',
            name: 'workplace',
            component: './Dashboard/Workplace',
          },
        ],
      },
      // list
      {
        name: 'result',
        icon: 'check-circle-o',
        path: '/result',
        routes: [
          // result
          {
            path: '/result/success',
            name: 'success',
            component: './Result/Success',
          },
          { path: '/result/fail', name: 'fail', component: './Result/Error' },
        ],
      },
      {
        name: 'exception',
        icon: 'warning',
        path: '/exception',
        routes: [
          // exception
          {
            path: '/exception/403',
            name: 'not-permission',
            component: './Exception/403',
          },
          {
            path: '/exception/404',
            name: 'not-find',
            component: './Exception/404v2',
          },
          {
            path: '/exception/500',
            name: 'server-error',
            component: './Exception/500',
          },
          {
            path: '/exception/trigger',
            name: 'trigger',
            hideInMenu: true,
            component: './Exception/TriggerException',
          },
        ],
      },
      {
        component: '404',
      },
    ],
  },
];
